package com.wva.tomcat;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet3.0 不用在配置web.xml了
 *  支持注解配置
 */
@WebServlet(name = "helloServlet", value = "/hello-servlet")
//@WebServlet("/helloServlet")
public class Demo02HttpServlet extends HttpServlet {

    public void init() {
    }

    public void doGet(HttpServletRequest request, HttpServletResponse response) {
        System.out.println("doGet被执行....");
        System.out.println("Servlet3.0来了.......");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) {
        System.out.println("doPost被执行....");
    }

    public void destroy() {

    }
}